<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/include.inc.jsp"%>
<%
	String path = request.getContextPath();
%>
<html>
<head>
<meta charset="utf-8" />
<title>后台管理</title>

<link rel="shortcut icon" href="${path}/styles/images/style/2015_logo.gif">
<script src="<%=path %>/styles/b-jui/js/jquery-1.7.2.min.js"></script>
<script src="<%=path%>/styles/js/login/login_form_validation.js"></script>
<script src="<%=path%>/styles/js/login/messages_zh.js"></script>
<link rel="stylesheet" href="<%=path%>/styles/css/login/screen.css">
<link rel="stylesheet" href="<%=path%>/styles/css/login/cmxform.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/styles/css/login.css" />
<script type="text/javascript" language="JavaScript" charset="UTF-8">
	document.onkeydown = function(event) {
		var e = event || window.event || arguments.callee.caller.arguments[0];
		if (e && e.keyCode == 13) { // enter 键
			login();
		}
	};
</script>
</head>
<body class="s-bg">
	<div class="g-layout-page">
		<div class="g-top">
			<div class="m-head">
				<div class="logo">
					<h1 class="z-ab-1">后台管理平台</h1>
				</div>
			</div>
		</div>
		<div class="g-content">
			<div class="g-box3  s-bg2">
				<div class="m-login">
					<div class="ins">
						<form id="formID1" name="formID" method="post" action="${path}/doLogin">
							<div class="u-title">
								<img class="ico-pic"
									src="<%=path%>/styles/images/style/ico_user.png" /><span
									class="text">登录</span>
							</div>
							<div class="u-inp">
								<div class="cell">
									<i class="ico"><img src="<%=path%>/styles/images/style/ico_3.png" /></i>
									<input required class="text w-260" type="text" name="loginName" id="loginName" />
									<label id="loginName_lab" for="loginName" class="error" style="font-size: 13px" <c:if test="${name_error == null}">style="display: none;"</c:if> >
										${name_error}
									</label>
								</div>
								<div class="cell">
									<i class="ico"><img src="<%=path%>/styles/images/style/ico_2.png" /></i>
									<input required class="text w-260" name="passWord" id="passWord" type="password" />
									<label id="password_lab" for="passWord" class="error" style="font-size: 13px" <c:if test="${pass_error == null}">style="display: none;"</c:if>>
										${pass_error}
									</label>
								</div>
								<div class="cell">
									<i class="ico"><img src="<%=path%>/styles/images/style/ico_1.png" /></i> 
									<input required class="text w-130" type="text" name="code" id="validate" onkeyup="checkIsNull('validate')" /> 
									<img id="validate_img" src="${path}/createValidate" style="cursor: pointer;" title="看不清？换一张"  /> 
									<label id="validate_lab" for="validate" class="error" <c:if test="${code_error == null}">style="display: none;"</c:if>>${code_error}</label>
								</div>
								<div class="cell">
									<button class="u-btn-log" onclick="login()">登 录</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(window).keydown(function(event) {
			if (event.keyCode == 13) {
				login();
			}
		});
		$("#validate_img").click(function(){
	        $("#validate_img").attr("src","${path}/createValidate?"+Math.random());
	    });
		function login() {
			$("#formID1").validate();
			$("#formID1").submit();
		}
		if (false) {
			if (false) {
				$("#password_lab").show();
				$("#password_lab").text("密码错误");
			} else {
				$("#loginName_lab").show();
				$("#loginName_lab").text("");
			}
		}
	</script>
</body>
</html>
